// import com.alibaba.druid.sql.ast.SQLName_ptr;
// import com.alibaba.druid.sql.ast.SQLStatementImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

#include "SQLAlterViewRenameStatement.h"
#include "../../visitor/SQLASTVisitor.h"
#include "../SQLName.h"

SQLName_ptr SQLAlterViewRenameStatement::getName()
{
  return name;
}

void SQLAlterViewRenameStatement::setName(SQLName_ptr name)
{
  if (name != nullptr)
  {
    name->setParent(SharedObject(SQLAlterViewRenameStatement));
  }
  this->name = name;
}

SQLName_ptr SQLAlterViewRenameStatement::getTo()
{
  return to;
}

void SQLAlterViewRenameStatement::setTo(SQLName_ptr x)
{
  if (x != nullptr)
  {
    x->setParent(SharedObject(SQLAlterViewRenameStatement));
  }
  this->to = x;
}

SQLName_ptr SQLAlterViewRenameStatement::getChangeOwnerTo()
{
  return changeOwnerTo;
}

void SQLAlterViewRenameStatement::setChangeOwnerTo(SQLName_ptr x)
{
  if (x != nullptr)
  {
    x->setParent(SharedObject(SQLAlterViewRenameStatement));
  }
  this->changeOwnerTo = x;
}

// @Override
void SQLAlterViewRenameStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLAlterViewRenameStatement)))
  {
    acceptChild(visitor, name);
    acceptChild(visitor, to);
    acceptChild(visitor, changeOwnerTo);
  }
  visitor->endVisit(SharedObject(SQLAlterViewRenameStatement));
}
